package com.nineclock.system.controller;


import com.nineclock.common.entity.Result;
import com.nineclock.system.dto.SysCompanyUserDTO;
import com.nineclock.system.service.SysCompanyUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(value = "组织管理接口", tags = "系统服务")
@RestController
@RequestMapping("/organization")
public class OrganizationController {

    @Autowired
    private SysCompanyUserService userService;

    //组织架构: 查询组织所有员工
    //接口路径：GET/sys/organization/members/simple
    @ApiOperation("组织架构: 查询组织所有员工")
    @GetMapping("members/simple")
    public Result<List<SysCompanyUserDTO>> queryCompanyMemberList(){
        List<SysCompanyUserDTO> sysCompanyUserDTOList = userService.queryCompanyMemberList();
        return Result.success(sysCompanyUserDTOList);
    }
}
